extends Node
@onready var player: Player = $"../.."
@onready var sprite_2d: Sprite2D = $"../Sprite2D"

var spriteArray : Array[Sprite2D]
var is_begin:bool = false
#幻影步

func _process(delta: float) -> void:
	if is_begin:
		if (get_tree().get_frame()%6) == 0:
			var newSprite:Sprite2D = sprite_2d.duplicate()
			get_tree().root.add_child(newSprite)
			newSprite.z_index = 0
			newSprite.modulate.a = 0
			if player.player_input_synchronizer_component:
				var aim_vector = player.player_input_synchronizer_component.aim_vector
				newSprite.scale = Vector2.ONE if aim_vector.x > 0 else Vector2(-1, 1)
			spriteArray.append(newSprite)
			newSprite.global_position = player.global_position 
			newSprite.StartFading()
